import service from "../config";

// 登录
export function login(data) {
    return service({
        url: "/auth/login/",
        method: "POST",
        data
    });
}

// 注册
export function register(data) {
    return service({
        url: "/auth/users/register/",
        method: "POST",
        data
    });
}

// 刷新 Token
export function refreshToken(refresh) {
    return service({
        url: "/auth/token/refresh/",
        method: "POST",
        data: { refresh }
    });
}

// 获取当前用户信息
export function fetchProfile() {
    return service({
        url: "/auth/users/profile/",
        method: "GET"
    });
}
